Repository navigation
[6.x] Stop the Playwright server at the end of browser test runs - #20452
Merged
Merged
Conversation
pest-plugin-browser 5.2.0 starts the server with sh -c and no exec, so stopping it ends only the shell and leaves node running with a copy of Pest's output pipe. Start it with exec until a fixed release is out. Amp-Thread-ID: https://ampcode.com/threads/T-01a1b5f5-1796-77e0-a2fa-5740cad41802 Co-authored-by: Amp <amp@ampcode.com>
brandonkelly
approved these changes
Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
pest-plugin-browser 5.2.0 starts the Playwright server with
sh -cand noexec. On Linux, dash forks node as a child, sostop()at the end of the run kills the shell and node keeps running:Every browser run leaves a server behind, and because node keeps a copy of Pest's output pipe,
vendor/bin/pest tests/Browser/… | tailnever returns.tests/Pest.phpnow creates the plugin'sPlaywrightNpmServerwithexecin front of the command and stores it inServerManager, which builds its server with??=and keeps it. It only applies on non-Windows systems with the plugin at 5.2.0 or earlier, because a fixed release adds its ownexecandexec execfails. Remove it once the upstream fix is released.Evidence
pest tests/Browser/Cp/AuthenticationTest.php | tail -3hangs (over 2.5 min); an orphanednode … run-serverwith parent PID 1 holdstail's input pipe.pest --parallel --processes=2 tests/Browser/Cp/Settings: 16 passed, onerun-serverleft running.After: the piped run returns in about 15s, 2 of 2 runs, no processes left. The parallel run: 16 passed, no processes left. Unit tests start no server.
Related issues